#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "kylin-activation.h"
#include "text-i18n.h"

/*
 * kylin_activation_print_result_message, print message according to result number
 */
extern void kylin_activation_print_result_message(int result);

int main(int argc, char** argv)
{
	int result;
	char* hw_info = NULL;

	setlocale(LC_MESSAGES, "");
	bindtextdomain (PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);
	bind_textdomain_codeset(PACKAGE, "utf8");

    hw_info = kylin_activation_get_encrypted_hardware_info(&result);
	if(!hw_info || result != NO_ERROR)
	{
		kylin_activation_print_result_message(result);
		exit(result);
	}

	if(hw_info)
	{
		printf("%s\n", hw_info);
	}

	if(hw_info)
		free(hw_info);

	exit(result);
}
